package models

import (
	"MaternalBaby/api/utils"
	"time"
)

type User struct {
	Id       int
	Avatar   string
	Name     string
	Phone    string
	Email    string
	Password string
	Token    string
	DeviceId string

	CreateTime time.Time `orm:"auto_now_add;type(datetime)"`
}

func (m User) Info() User {
	m.Avatar = utils.GetImageUrl(m.Avatar, "image/format,png")
	m.Password = ""
	return m
}

func (m User) Summary() User {
	m = m.Info()
	m.Token = ""
	return m
}
